#version 330 core
layout(location =0) in vec3 qt_Vertex;
layout (location = 1) in vec3 normal;
layout(location =2) in vec2 qt_MultiTexCoord0;


uniform mat4 model;
uniform mat4 view;
uniform mat4 projection;

struct VS_OUT
{
    //世界空间坐标
    vec3 vertex;
    //世界空间法线
    vec3 normal;
    //纹理坐标
    vec2 texcoord;
};
out VS_OUT vs_out;

void main(void)
{
    gl_Position = projection * view * model * vec4(qt_Vertex,1);
    vs_out.texcoord = qt_MultiTexCoord0;
    vs_out.vertex=vec3(model*vec4(qt_Vertex,1.0f));
    vs_out.normal=vec3(model*vec4(normal,0));
    vs_out.normal=normalize(vs_out.normal);
}



//#version 330 core
//layout(location =0) in vec3 qt_Vertex;
//layout(location =1) in vec2 qt_MultiTexCoord0;

//uniform mat4 model;
//uniform mat4 view;
//uniform mat4 projection;
//uniform vec3 normal;

//struct VS_OUT
//{
//   vec2 qt_TexCoord0;
//   vec3 qt_Normal;
//   vec3 qt_FragPos;
//};
//out VS_OUT vs_out;

//void main(void)
//{
//    gl_Position = projection * view * model * vec4(qt_Vertex,1);
//    vs_out.qt_TexCoord0 = qt_MultiTexCoord0;

//    mat3 mat;
//    mat[0]=model[0].xyz;
//    mat[1]=model[1].xyz;
//    mat[2]=model[2].xyz;
//    vs_out.qt_Normal=mat*normal;

//    vs_out.qt_FragPos=vec3(model*vec4(qt_Vertex,1.0f));
//}
